<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <div class="container ">
    <h2><span>Countdown to NCEE</span> 2021</h2>
    <div class="countdown">
      <div id="day">NA</div>
      <div id="hour">NA</div>
      <div id="minute">NA</div>
      <div id="second">NA</div>
    </div>
  </div>
  <script type="text/javascript">

    function getEndTime(myYear) {
      var myEndTime = new Date('' + myYear + '/06/07 00:00:00');
      return myEndTime;
    }

    function countDown() {
      var mydate = new Date();
      var year = '2021';
      var EndTime = getEndTime(year);
      var NowTime = new Date();
      if ((EndTime.getTime() - NowTime.getTime()) < 0) {
        year = mydate.getFullYear() + 1;
        EndTime = getEndTime(year);
      }
      var t = EndTime.getTime() - NowTime.getTime();



      var d = Math.floor(t / 1000 / 60 / 60 / 24);
      var h = Math.floor(t / 1000 / 60 / 60 % 24);
      var m = Math.floor(t / 1000 / 60 % 60);
      var s = Math.floor(t / 1000 % 60);

      document.getElementById('day').innerText = d;
      document.getElementById('hour').innerText = h;
      document.getElementById('minute').innerText = m;
      document.getElementById('second').innerText = s;
    }
    setInterval(countDown, 1000);
  </script>
</body>

</html>